<template>
  <div id="app">
    <LayoutPage />
  </div>
</template>

<script>
import scssVar from "@/styles/variables.scss";
// 布局组件
import LayoutPage from "@/components/layout/LayoutPage.vue";
export default {
  components: { LayoutPage },
  data() {
    return {
      from: "",
    };
  },
  watch: {},
  created() {
    this.setFontSize();
    window.addEventListener("resize", this.setFontSize);
  },
  methods: {
    setFontSize() {
      let designW = 880; // 设计图宽度
      let maxWidth = parseInt(scssVar.maxWidth); // 最大宽度
      let bodyW = document.body.clientWidth; // 文档宽度
      bodyW = bodyW > maxWidth ? maxWidth : bodyW;
      let fontSize = (bodyW / designW) * 100;
      document.documentElement.style.fontSize = fontSize + "px"; // 设置全局文字大小
    },
  },
};
</script>

<style lang="scss">
body,
html,
#app {
  padding: 0;
  margin: 0;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  width: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #333;
  user-select: none;
  display: flex;
  flex-direction: column;
}
</style>
